import {observable, action} from "mobx";
import request from "../utils/request";
import * as api from "../api/api";
import {LoadHoc, loading} from '../hoc/loadHoc';


export default class ComplainStore extends LoadHoc {
  /**
   * 保存举报信息
   */
  @loading @action
  async pushComplain(params: {
    form: {
      picture: string,
      status: number,
      description: string,
      phoneNumber: string,
    },
    callBack: () => void
  }) {
    const {form, callBack} = params
    await request(api.AppcomplainApiFetchParamCreactor.appcomplainPushComplainAsync({
        form
      }
    ))
    callBack && callBack()
  }
}
